var EventEmitter = require('events');
var util = require('util');

function MyThing() {
  EventEmitter.call(this);

  console.log(" have done sth");
  setImmediate(emitThing1, this);
}
util.inherits(MyThing, EventEmitter);

function emitThing1(self) {
  self.emit('thing1');
}

var mt = new MyThing();

mt.on('thing1', function onThing1() {
  // Whoot!
  console.log("here we are, i'm the response!");
});
